#include <iostream>

#include <ring_queue.h>

int main()
{
    RingQueue<int, 4> rq;

    rq.Push(1);
    rq.Push(2);
    for (const auto & i : rq) {
        std::cout << i << " ";
    }
    std::cout << "\n";  // 1 2
    for (auto it = rq.rbegin(); it != rq.rend(); it++) {
        std::cout << *it << " ";
    }
    std::cout << "\n";  // 2 1

    rq.Push(3);
    rq.Push(4);
    for (const auto & i : rq) {
        std::cout << i << " ";
    }
    std::cout << "\n";  // 1 2 3 4
    for (auto it = rq.rbegin(); it != rq.rend(); it++) {
        std::cout << *it << " ";
    }
    std::cout << "\n";  // 4 3 2 1

    rq.Push(5);
    rq.Push(6);
    for (const auto & i : rq) {
        std::cout << i << " ";
    }
    std::cout << "\n";  // 3 4 5 6
    for (auto it = rq.rbegin(); it != rq.rend(); it++) {
        std::cout << *it << " ";
    }
    std::cout << "\n";  // 6 5 4 3

    rq.Clear();
    for (const auto & i : rq) {
        std::cout << i << " ";
    }
    std::cout << "\n";  //
    return 0;
}
